﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace The_Last_Knights.GUI
{
    public class DisableButton: NormalButton
    {
        protected bool _isEnabled;

        public bool IsEnabled
        {
            get { return _isEnabled; }
            set { _isEnabled = value; }
        }

        public DisableButton(Game game, Text text, string normal, string hover, string push, string ID, Vector2 pos, Vector2 size, Texture2D background) 
            : base(game, text, normal, hover, push, ID, pos, size, background)
        {
            _isEnabled = false;
        }

        public override void Update(GameTime gameTime)
        {
            if (!_isEnabled)
                return;
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            if (!_isEnabled)
            {
                SpriteBatch sb = GetSpriteBatch();
                if (sb != null)
                {
                    sb.Begin();
                    sb.Draw(_state[0], GetBoundary(), Color.DarkGray);                    
                    sb.End();
                }
                return;
            }
            base.Draw(gameTime);
        }
    }
}
